// BookInsertDlg.cpp : implementation file
//

#include "stdafx.h"
#include "library.h"
#include "BookInsertDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBookInsertDlg dialog


CBookInsertDlg::CBookInsertDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CBookInsertDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBookInsertDlg)
	m_strAuthor = _T("");
	m_strID = _T("");
	m_strISBN = _T("");
	m_strName = _T("");
	m_strPress = _T("");
	//}}AFX_DATA_INIT
	m_bState = FALSE;
}


void CBookInsertDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBookInsertDlg)
	DDX_Text(pDX, IDC_BOOK_INSERT_AUTHOR, m_strAuthor);
	DDX_Text(pDX, IDC_BOOK_INSERT_ID, m_strID);
	DDX_Text(pDX, IDC_BOOK_INSERT_ISBN, m_strISBN);
	DDX_Text(pDX, IDC_BOOK_INSERT_NAME, m_strName);
	DDX_Text(pDX, IDC_BOOK_INSERT_PRESS, m_strPress);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBookInsertDlg, CDialog)
	//{{AFX_MSG_MAP(CBookInsertDlg)
	ON_BN_CLICKED(IDC_BOOK_INSERT_CANCEL_BUTTON, OnBookInsertCancelButton)
	ON_BN_CLICKED(IDC_BOOK_INSERT_OK_BUTTON, OnBookInsertOkButton)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBookInsertDlg message handlers

void CBookInsertDlg::OnBookInsertCancelButton() 
{
	// TODO: Add your control notification handler code here
	m_bState = FALSE;
	CDialog::OnCancel();
}

void CBookInsertDlg::OnBookInsertOkButton() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	m_bState = TRUE;
	CDialog::OnOK();
}

int CBookInsertDlg::DoModal() 
{
	// TODO: Add your specialized code here and/or call the base class
	CDialog::DoModal();
	return m_bState;
}
